<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pyprocessing.flippolicy</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pyprocessing-module.html">Package&nbsp;pyprocessing</a> ::
        Module&nbsp;flippolicy
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyprocessing.flippolicy-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pyprocessing.flippolicy-module.html">Module pyprocessing.flippolicy</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring">This module contains several window classes derived from pyglet's</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">window classes. They implement variations on the standard way</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">of handling the flip method. These are necessary because of the</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring">implementation-dependent way used by OpenGL to flip between the back and</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">the front buffer. </tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-docstring">In most cases where a modern graphics board is supported</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-docstring">by a recent driver, flipping works by copying the back to the front buffer,</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-docstring">which is necessary whenever the screen is not completely redrawn from</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring">scratch between one frame and the next. If this is the case in your installation,</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring">the regular PyprocessingWindow, which is merely a pyglet.window.Window under </tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring">another name, should be used and will give you the best performance.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring">Some drivers, however, do not implement flip by copying, but merely makes the </tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">video controller address the other video memory buffer. This is what is called</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">flipping by swapping. In such cases, programs which rely on a stable frame</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">buffer will not work as expected. I spent a long time looking for portable</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">ways of enforcing a copy flip, but it seems that there is no reliable way of</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">doing that. </tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">One way of coping with the problem is to use single buffering, so that drawing</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">is actually performed on the front buffer. This is not a good idea in</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">general, because the drawing may result in flickering and other visual</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">visual artifacts. Nevertheless, I found that the Intel 945 express chipset</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">works fairly well in this mode under MS Windows. Other driver/board/OS </tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">combinations might also work well in this mode. If this is the case, </tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">instancing a SingleBufferWindow will solve the problem.</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">Another way of providing a stable drawing buffer is to draw to a separate</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">off-screen buffer. The most efficient way of doing this is to use a Frame</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">Buffer Object, or FBO. The idea then is to copy the FBO to the back buffer</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">just before the flip. The FBOWindow implements just this.</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">Unfortunately the FBO extension is not common in old hardware. In this case,</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">another type of buffer might be used to store a copy of the back buffer. The </tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">idea is to copy the back buffer to such an auxiliary buffer, flip and then </tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">copy it back. The simplest, but probably not the most efficient way of doing</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">this is to use the accumulation buffer, which can be copied from/to with a</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">single glAccum instruction. The AccumWindow implements this policy.</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">The default flipping policy is governed by appropriate calls to the</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">hint() function just before calling size(). You might wish to change the default</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">by editting the config variable in the globs submodule.</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">pyglet</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">ctypes</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">pyglet</tt><tt class="py-op">.</tt><tt class="py-name">gl</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module pyprocessing.fbo=pyprocessing.fbo-module.html"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-0', 'fbo', 'link-0');">fbo</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class pyprocessing.fbo.FBO=pyprocessing.fbo.FBO-class.html"><a title="pyprocessing.fbo.FBO" class="py-name" href="#" onclick="return doclink('link-1', 'FBO', 'link-1');">FBO</a></tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module pyprocessing.pimage=pyprocessing.pimage-module.html"><a title="pyprocessing.pimage" class="py-name" href="#" onclick="return doclink('link-2', 'pimage', 'link-2');">pimage</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-name">__all__</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'PyprocessingWindow'</tt><tt class="py-op">,</tt><tt class="py-string">'FBOWindow'</tt><tt class="py-op">,</tt><tt class="py-string">'SingleBufferWindow'</tt><tt class="py-op">,</tt><tt class="py-string">'AccumWindow'</tt><tt class="py-op">,</tt><tt class="py-string">'BackupWindow'</tt><tt class="py-op">]</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"> </tt>
<a name="PyprocessingWindow"></a><div id="PyprocessingWindow-def"><a name="L56"></a><tt class="py-lineno"> 56</tt> <a class="py-toggle" href="#" id="PyprocessingWindow-toggle" onclick="return toggle('PyprocessingWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.flippolicy.PyprocessingWindow-class.html">PyprocessingWindow</a> <tt class="py-op">(</tt><tt class="py-base-class">pyglet</tt><tt class="py-op">.</tt><tt class="py-base-class">window</tt><tt class="py-op">.</tt><tt class="py-base-class">Window</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyprocessingWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyprocessingWindow-expanded"><a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">    <tt class="py-docstring">"""This is just a wrapper for the pyglet window class. If any </tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-docstring">    window method or attribute should be messed with for all of pyprocessing's</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">    window classes, it's best to do it here."""</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">    <tt class="py-keyword">pass</tt> </tt>
</div><a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"> </tt>
<a name="FBOWindow"></a><div id="FBOWindow-def"><a name="L62"></a><tt class="py-lineno"> 62</tt> <a class="py-toggle" href="#" id="FBOWindow-toggle" onclick="return toggle('FBOWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.flippolicy.FBOWindow-class.html">FBOWindow</a><tt class="py-op">(</tt><tt class="py-base-class">PyprocessingWindow</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FBOWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="FBOWindow-expanded"><a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">    <tt class="py-docstring">"""This is a pyglet window where drawing in fact occurs inside a FBO.</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">    The flip method is overridden so that instead of merely swapping the</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">    back and front buffers, the FBO is first blitted onto the back buffer.</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">    The idea is to provide a stable drawing canvas which is not erased or</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">    corrupted by the flip."""</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">     </tt>
<a name="FBOWindow.__init__"></a><div id="FBOWindow.__init__-def"><a name="L69"></a><tt class="py-lineno"> 69</tt> <a class="py-toggle" href="#" id="FBOWindow.__init__-toggle" onclick="return toggle('FBOWindow.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.FBOWindow-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">keyargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FBOWindow.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FBOWindow.__init__-expanded"><a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-docstring">"""Constructor"""</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-comment"># construct the base class</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-3" class="py-name" targets="Class pyprocessing.flippolicy.FBOWindow=pyprocessing.flippolicy.FBOWindow-class.html"><a title="pyprocessing.flippolicy.FBOWindow" class="py-name" href="#" onclick="return doclink('link-3', 'FBOWindow', 'link-3');">FBOWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method pyprocessing.fbo.FBO.__init__()=pyprocessing.fbo.FBO-class.html#__init__,Method pyprocessing.flippolicy.AccumWindow.__init__()=pyprocessing.flippolicy.AccumWindow-class.html#__init__,Method pyprocessing.flippolicy.BackupWindow.__init__()=pyprocessing.flippolicy.BackupWindow-class.html#__init__,Method pyprocessing.flippolicy.FBOWindow.__init__()=pyprocessing.flippolicy.FBOWindow-class.html#__init__,Method pyprocessing.flippolicy.SingleBufferWindow.__init__()=pyprocessing.flippolicy.SingleBufferWindow-class.html#__init__,Method pyprocessing.pimage.PImage.__init__()=pyprocessing.pimage.PImage-class.html#__init__,Method pyprocessing.pvector.PVector.__init__()=pyprocessing.pvector.PVector-class.html#__init__,Method pyprocessing.pvector.overload.__init__()=pyprocessing.pvector.overload-class.html#__init__,Method pyprocessing.shapes.CatmullRomBlend.__init__()=pyprocessing.shapes.CatmullRomBlend-class.html#__init__"><a title="pyprocessing.fbo.FBO.__init__
pyprocessing.flippolicy.AccumWindow.__init__
pyprocessing.flippolicy.BackupWindow.__init__
pyprocessing.flippolicy.FBOWindow.__init__
pyprocessing.flippolicy.SingleBufferWindow.__init__
pyprocessing.pimage.PImage.__init__
pyprocessing.pvector.PVector.__init__
pyprocessing.pvector.overload.__init__
pyprocessing.shapes.CatmullRomBlend.__init__" class="py-name" href="#" onclick="return doclink('link-4', '__init__', 'link-4');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">keyargs</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-comment"># construct the fbo and attach it</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-5', 'fbo', 'link-0');">fbo</a></tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="pyprocessing.fbo.FBO" class="py-name" href="#" onclick="return doclink('link-6', 'FBO', 'link-1');">FBO</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Variable pyprocessing.globs.screen.width=pyprocessing.globs.screen-class.html#width,Variable pyprocessing.pimage.PImage.width=pyprocessing.pimage.PImage-class.html#width"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-7', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Variable pyprocessing.globs.screen.height=pyprocessing.globs.screen-class.html#height,Variable pyprocessing.pimage.PImage.height=pyprocessing.pimage.PImage-class.html#height"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-8', 'height', 'link-8');">height</a></tt><tt class="py-op">)</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-9', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method pyprocessing.fbo.FBO.attach()=pyprocessing.fbo.FBO-class.html#attach"><a title="pyprocessing.fbo.FBO.attach" class="py-name" href="#" onclick="return doclink('link-10', 'attach', 'link-10');">attach</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">         </tt>
<a name="FBOWindow.flip"></a><div id="FBOWindow.flip-def"><a name="L77"></a><tt class="py-lineno"> 77</tt> <a class="py-toggle" href="#" id="FBOWindow.flip-toggle" onclick="return toggle('FBOWindow.flip');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.FBOWindow-class.html#flip">flip</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FBOWindow.flip-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FBOWindow.flip-expanded"><a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">        <tt class="py-docstring">"""Override the flip method."""</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-comment"># cease using the FBO and start using the regular frame buffer</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-11', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method pyprocessing.fbo.FBO.detach()=pyprocessing.fbo.FBO-class.html#detach"><a title="pyprocessing.fbo.FBO.detach" class="py-name" href="#" onclick="return doclink('link-12', 'detach', 'link-12');">detach</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-comment"># save the OpenGL state</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-13" class="py-name" targets="Variable pyprocessing.lights'.glMatrixMode=pyprocessing.lights%27-module.html#glMatrixMode"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-13', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-14" class="py-name" targets="Variable pyprocessing.lights'.GL_PROJECTION=pyprocessing.lights%27-module.html#GL_PROJECTION"><a title="pyprocessing.lights'.GL_PROJECTION" class="py-name" href="#" onclick="return doclink('link-14', 'GL_PROJECTION', 'link-14');">GL_PROJECTION</a></tt><tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt id="link-15" class="py-name" targets="Variable pyprocessing.lights'.glPushMatrix=pyprocessing.lights%27-module.html#glPushMatrix"><a title="pyprocessing.lights'.glPushMatrix" class="py-name" href="#" onclick="return doclink('link-15', 'glPushMatrix', 'link-15');">glPushMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt id="link-16" class="py-name" targets="Variable pyprocessing.lights'.glLoadIdentity=pyprocessing.lights%27-module.html#glLoadIdentity"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-16', 'glLoadIdentity', 'link-16');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt id="link-17" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-17', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-18" class="py-name" targets="Variable pyprocessing.lights'.GL_MODELVIEW=pyprocessing.lights%27-module.html#GL_MODELVIEW"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-18', 'GL_MODELVIEW', 'link-18');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt id="link-19" class="py-name"><a title="pyprocessing.lights'.glPushMatrix" class="py-name" href="#" onclick="return doclink('link-19', 'glPushMatrix', 'link-15');">glPushMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt id="link-20" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-20', 'glLoadIdentity', 'link-16');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt id="link-21" class="py-name" targets="Variable pyprocessing.lights'.glViewport=pyprocessing.lights%27-module.html#glViewport"><a title="pyprocessing.lights'.glViewport" class="py-name" href="#" onclick="return doclink('link-21', 'glViewport', 'link-21');">glViewport</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-22', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-23', 'height', 'link-8');">height</a></tt><tt class="py-op">)</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-comment"># prepares and blits the FBO buffer onto the back buffer.</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-24" class="py-name" targets="Variable pyprocessing.lights'.glBindFramebufferEXT=pyprocessing.lights%27-module.html#glBindFramebufferEXT"><a title="pyprocessing.lights'.glBindFramebufferEXT" class="py-name" href="#" onclick="return doclink('link-24', 'glBindFramebufferEXT', 'link-24');">glBindFramebufferEXT</a></tt><tt class="py-op">(</tt><tt id="link-25" class="py-name" targets="Variable pyprocessing.lights'.GL_READ_FRAMEBUFFER_EXT=pyprocessing.lights%27-module.html#GL_READ_FRAMEBUFFER_EXT"><a title="pyprocessing.lights'.GL_READ_FRAMEBUFFER_EXT" class="py-name" href="#" onclick="return doclink('link-25', 'GL_READ_FRAMEBUFFER_EXT', 'link-25');">GL_READ_FRAMEBUFFER_EXT</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-26', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt class="py-name">framebuffer</tt><tt class="py-op">)</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt id="link-27" class="py-name" targets="Variable pyprocessing.lights'.glReadBuffer=pyprocessing.lights%27-module.html#glReadBuffer"><a title="pyprocessing.lights'.glReadBuffer" class="py-name" href="#" onclick="return doclink('link-27', 'glReadBuffer', 'link-27');">glReadBuffer</a></tt><tt class="py-op">(</tt><tt id="link-28" class="py-name" targets="Variable pyprocessing.lights'.GL_COLOR_ATTACHMENT0_EXT=pyprocessing.lights%27-module.html#GL_COLOR_ATTACHMENT0_EXT"><a title="pyprocessing.lights'.GL_COLOR_ATTACHMENT0_EXT" class="py-name" href="#" onclick="return doclink('link-28', 'GL_COLOR_ATTACHMENT0_EXT', 'link-28');">GL_COLOR_ATTACHMENT0_EXT</a></tt><tt class="py-op">)</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt id="link-29" class="py-name"><a title="pyprocessing.lights'.glBindFramebufferEXT" class="py-name" href="#" onclick="return doclink('link-29', 'glBindFramebufferEXT', 'link-24');">glBindFramebufferEXT</a></tt><tt class="py-op">(</tt><tt id="link-30" class="py-name" targets="Variable pyprocessing.lights'.GL_DRAW_FRAMEBUFFER_EXT=pyprocessing.lights%27-module.html#GL_DRAW_FRAMEBUFFER_EXT"><a title="pyprocessing.lights'.GL_DRAW_FRAMEBUFFER_EXT" class="py-name" href="#" onclick="return doclink('link-30', 'GL_DRAW_FRAMEBUFFER_EXT', 'link-30');">GL_DRAW_FRAMEBUFFER_EXT</a></tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt id="link-31" class="py-name" targets="Variable pyprocessing.lights'.glDrawBuffer=pyprocessing.lights%27-module.html#glDrawBuffer"><a title="pyprocessing.lights'.glDrawBuffer" class="py-name" href="#" onclick="return doclink('link-31', 'glDrawBuffer', 'link-31');">glDrawBuffer</a></tt><tt class="py-op">(</tt><tt id="link-32" class="py-name" targets="Variable pyprocessing.lights'.GL_BACK=pyprocessing.lights%27-module.html#GL_BACK"><a title="pyprocessing.lights'.GL_BACK" class="py-name" href="#" onclick="return doclink('link-32', 'GL_BACK', 'link-32');">GL_BACK</a></tt><tt class="py-op">)</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt id="link-33" class="py-name" targets="Variable pyprocessing.lights'.glBlitFramebufferEXT=pyprocessing.lights%27-module.html#glBlitFramebufferEXT"><a title="pyprocessing.lights'.glBlitFramebufferEXT" class="py-name" href="#" onclick="return doclink('link-33', 'glBlitFramebufferEXT', 'link-33');">glBlitFramebufferEXT</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-34', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-35', 'height', 'link-8');">height</a></tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-36', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-37', 'height', 'link-8');">height</a></tt><tt class="py-op">,</tt> <tt id="link-38" class="py-name" targets="Variable pyprocessing.lights'.GL_COLOR_BUFFER_BIT=pyprocessing.lights%27-module.html#GL_COLOR_BUFFER_BIT"><a title="pyprocessing.lights'.GL_COLOR_BUFFER_BIT" class="py-name" href="#" onclick="return doclink('link-38', 'GL_COLOR_BUFFER_BIT', 'link-38');">GL_COLOR_BUFFER_BIT</a></tt><tt class="py-op">,</tt> <tt id="link-39" class="py-name" targets="Variable pyprocessing.lights'.GL_NEAREST=pyprocessing.lights%27-module.html#GL_NEAREST"><a title="pyprocessing.lights'.GL_NEAREST" class="py-name" href="#" onclick="return doclink('link-39', 'GL_NEAREST', 'link-39');">GL_NEAREST</a></tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt id="link-40" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-40', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-41" class="py-name"><a title="pyprocessing.lights'.GL_PROJECTION" class="py-name" href="#" onclick="return doclink('link-41', 'GL_PROJECTION', 'link-14');">GL_PROJECTION</a></tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt id="link-42" class="py-name" targets="Variable pyprocessing.lights'.glPopMatrix=pyprocessing.lights%27-module.html#glPopMatrix"><a title="pyprocessing.lights'.glPopMatrix" class="py-name" href="#" onclick="return doclink('link-42', 'glPopMatrix', 'link-42');">glPopMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt id="link-43" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-43', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-44" class="py-name"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-44', 'GL_MODELVIEW', 'link-18');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt id="link-45" class="py-name"><a title="pyprocessing.lights'.glPopMatrix" class="py-name" href="#" onclick="return doclink('link-45', 'glPopMatrix', 'link-42');">glPopMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-comment"># do the actual flip</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">super</tt> <tt class="py-op">(</tt><tt id="link-46" class="py-name"><a title="pyprocessing.flippolicy.FBOWindow" class="py-name" href="#" onclick="return doclink('link-46', 'FBOWindow', 'link-3');">FBOWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name" targets="Method pyprocessing.flippolicy.AccumWindow.flip()=pyprocessing.flippolicy.AccumWindow-class.html#flip,Method pyprocessing.flippolicy.BackupWindow.flip()=pyprocessing.flippolicy.BackupWindow-class.html#flip,Method pyprocessing.flippolicy.FBOWindow.flip()=pyprocessing.flippolicy.FBOWindow-class.html#flip,Method pyprocessing.flippolicy.SingleBufferWindow.flip()=pyprocessing.flippolicy.SingleBufferWindow-class.html#flip"><a title="pyprocessing.flippolicy.AccumWindow.flip
pyprocessing.flippolicy.BackupWindow.flip
pyprocessing.flippolicy.FBOWindow.flip
pyprocessing.flippolicy.SingleBufferWindow.flip" class="py-name" href="#" onclick="return doclink('link-47', 'flip', 'link-47');">flip</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-comment"># reattach the fbo for further drawing</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-48', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="pyprocessing.fbo.FBO.attach" class="py-name" href="#" onclick="return doclink('link-49', 'attach', 'link-10');">attach</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">         </tt>
<a name="FBOWindow.on_resize"></a><div id="FBOWindow.on_resize-def"><a name="L104"></a><tt class="py-lineno">104</tt> <a class="py-toggle" href="#" id="FBOWindow.on_resize-toggle" onclick="return toggle('FBOWindow.on_resize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.FBOWindow-class.html#on_resize">on_resize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">w</tt><tt class="py-op">,</tt><tt class="py-param">h</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FBOWindow.on_resize-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FBOWindow.on_resize-expanded"><a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">super</tt> <tt class="py-op">(</tt><tt id="link-50" class="py-name"><a title="pyprocessing.flippolicy.FBOWindow" class="py-name" href="#" onclick="return doclink('link-50', 'FBOWindow', 'link-3');">FBOWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name" targets="Method pyprocessing.flippolicy.BackupWindow.on_resize()=pyprocessing.flippolicy.BackupWindow-class.html#on_resize,Method pyprocessing.flippolicy.FBOWindow.on_resize()=pyprocessing.flippolicy.FBOWindow-class.html#on_resize,Function pyprocessing.on_resize()=pyprocessing-module.html#on_resize"><a title="pyprocessing.flippolicy.BackupWindow.on_resize
pyprocessing.flippolicy.FBOWindow.on_resize
pyprocessing.on_resize" class="py-name" href="#" onclick="return doclink('link-51', 'on_resize', 'link-51');">on_resize</a></tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">,</tt><tt class="py-name">h</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-52', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt id="link-53" class="py-name"><a title="pyprocessing.fbo.FBO.detach" class="py-name" href="#" onclick="return doclink('link-53', 'detach', 'link-12');">detach</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-54', 'fbo', 'link-0');">fbo</a></tt> <tt class="py-op">=</tt> <tt id="link-55" class="py-name"><a title="pyprocessing.fbo.FBO" class="py-name" href="#" onclick="return doclink('link-55', 'FBO', 'link-1');">FBO</a></tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">,</tt><tt class="py-name">h</tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="pyprocessing.fbo" class="py-name" href="#" onclick="return doclink('link-56', 'fbo', 'link-0');">fbo</a></tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="pyprocessing.fbo.FBO.attach" class="py-name" href="#" onclick="return doclink('link-57', 'attach', 'link-10');">attach</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"> </tt>
<a name="SingleBufferWindow"></a><div id="SingleBufferWindow-def"><a name="L110"></a><tt class="py-lineno">110</tt> <a class="py-toggle" href="#" id="SingleBufferWindow-toggle" onclick="return toggle('SingleBufferWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.flippolicy.SingleBufferWindow-class.html">SingleBufferWindow</a><tt class="py-op">(</tt><tt class="py-base-class">PyprocessingWindow</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SingleBufferWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SingleBufferWindow-expanded"><a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">    <tt class="py-docstring">"""This is a pyglet window with a single buffer config."""</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">     </tt>
<a name="SingleBufferWindow.__init__"></a><div id="SingleBufferWindow.__init__-def"><a name="L113"></a><tt class="py-lineno">113</tt> <a class="py-toggle" href="#" id="SingleBufferWindow.__init__-toggle" onclick="return toggle('SingleBufferWindow.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.SingleBufferWindow-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">keyargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SingleBufferWindow.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SingleBufferWindow.__init__-expanded"><a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-docstring">"""Constructor"""</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-comment"># construct the base class</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-string">'config'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keyargs</tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">            <tt id="link-58" class="py-name" targets="Module pyprocessing.config=pyprocessing.config-module.html,Variable pyprocessing.globs.canvas.config=pyprocessing.globs.canvas-class.html#config"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-58', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">            <tt id="link-59" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-59', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Config</tt><tt class="py-op">(</tt><tt class="py-name">depth_size</tt><tt class="py-op">=</tt><tt class="py-number">24</tt><tt class="py-op">)</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt id="link-60" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-60', 'config', 'link-58');">config</a></tt><tt class="py-op">.</tt><tt class="py-name">double_buffer</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-61" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-61', 'config', 'link-58');">config</a></tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-62" class="py-name" targets="Class pyprocessing.flippolicy.SingleBufferWindow=pyprocessing.flippolicy.SingleBufferWindow-class.html"><a title="pyprocessing.flippolicy.SingleBufferWindow" class="py-name" href="#" onclick="return doclink('link-62', 'SingleBufferWindow', 'link-62');">SingleBufferWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="pyprocessing.fbo.FBO.__init__
pyprocessing.flippolicy.AccumWindow.__init__
pyprocessing.flippolicy.BackupWindow.__init__
pyprocessing.flippolicy.FBOWindow.__init__
pyprocessing.flippolicy.SingleBufferWindow.__init__
pyprocessing.pimage.PImage.__init__
pyprocessing.pvector.PVector.__init__
pyprocessing.pvector.overload.__init__
pyprocessing.shapes.CatmullRomBlend.__init__" class="py-name" href="#" onclick="return doclink('link-63', '__init__', 'link-4');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">keyargs</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt id="link-64" class="py-name"><a title="pyprocessing.lights'.glDrawBuffer" class="py-name" href="#" onclick="return doclink('link-64', 'glDrawBuffer', 'link-31');">glDrawBuffer</a></tt><tt class="py-op">(</tt><tt id="link-65" class="py-name" targets="Variable pyprocessing.lights'.GL_FRONT=pyprocessing.lights%27-module.html#GL_FRONT"><a title="pyprocessing.lights'.GL_FRONT" class="py-name" href="#" onclick="return doclink('link-65', 'GL_FRONT', 'link-65');">GL_FRONT</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">         </tt>
<a name="SingleBufferWindow.flip"></a><div id="SingleBufferWindow.flip-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="SingleBufferWindow.flip-toggle" onclick="return toggle('SingleBufferWindow.flip');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.SingleBufferWindow-class.html#flip">flip</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
</div></div><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">          </tt>
<a name="BackupWindow"></a><div id="BackupWindow-def"><a name="L127"></a><tt class="py-lineno">127</tt> <a class="py-toggle" href="#" id="BackupWindow-toggle" onclick="return toggle('BackupWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.flippolicy.BackupWindow-class.html">BackupWindow</a><tt class="py-op">(</tt><tt class="py-base-class">PyprocessingWindow</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BackupWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="BackupWindow-expanded"><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">    <tt class="py-docstring">"""This is a pyglet window for which an array is used to keep the back</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-docstring">    buffer contents consistent. The flip method is overridden so that </tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring">    instead of merely swapping the back and front buffers, the back buffer</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">    contents are copied to an array inside the CPU's memory, and after the flip</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring">    the contents are copied back to the back buffer."""</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">     </tt>
<a name="BackupWindow.__init__"></a><div id="BackupWindow.__init__-def"><a name="L134"></a><tt class="py-lineno">134</tt> <a class="py-toggle" href="#" id="BackupWindow.__init__-toggle" onclick="return toggle('BackupWindow.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.BackupWindow-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">keyargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BackupWindow.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="BackupWindow.__init__-expanded"><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">        <tt class="py-docstring">"""Constructor"""</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">        <tt class="py-comment"># construct the base class</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-string">'config'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keyargs</tt><tt class="py-op">:</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">            <tt id="link-66" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-66', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">            <tt id="link-67" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-67', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Config</tt><tt class="py-op">(</tt><tt class="py-name">double_buffer</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">depth_size</tt><tt class="py-op">=</tt><tt class="py-number">24</tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-68" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-68', 'config', 'link-58');">config</a></tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-69" class="py-name" targets="Class pyprocessing.flippolicy.BackupWindow=pyprocessing.flippolicy.BackupWindow-class.html"><a title="pyprocessing.flippolicy.BackupWindow" class="py-name" href="#" onclick="return doclink('link-69', 'BackupWindow', 'link-69');">BackupWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name"><a title="pyprocessing.fbo.FBO.__init__
pyprocessing.flippolicy.AccumWindow.__init__
pyprocessing.flippolicy.BackupWindow.__init__
pyprocessing.flippolicy.FBOWindow.__init__
pyprocessing.flippolicy.SingleBufferWindow.__init__
pyprocessing.pimage.PImage.__init__
pyprocessing.pvector.PVector.__init__
pyprocessing.pvector.overload.__init__
pyprocessing.shapes.CatmullRomBlend.__init__" class="py-name" href="#" onclick="return doclink('link-70', '__init__', 'link-4');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">keyargs</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">buffer</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-name">GLubyte</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-71" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-71', 'width', 'link-7');">width</a></tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-72" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-72', 'height', 'link-8');">height</a></tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">currentpos</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">c_int</tt><tt class="py-op">*</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">         </tt>
<a name="BackupWindow.flip"></a><div id="BackupWindow.flip-def"><a name="L146"></a><tt class="py-lineno">146</tt> <a class="py-toggle" href="#" id="BackupWindow.flip-toggle" onclick="return toggle('BackupWindow.flip');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.BackupWindow-class.html#flip">flip</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BackupWindow.flip-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="BackupWindow.flip-expanded"><a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-docstring">"""Override the flip method."""</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        <tt id="link-73" class="py-name" targets="Variable pyprocessing.lights'.glReadPixels=pyprocessing.lights%27-module.html#glReadPixels"><a title="pyprocessing.lights'.glReadPixels" class="py-name" href="#" onclick="return doclink('link-73', 'glReadPixels', 'link-73');">glReadPixels</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-74" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-74', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-75', 'height', 'link-8');">height</a></tt><tt class="py-op">,</tt> <tt id="link-76" class="py-name" targets="Variable pyprocessing.lights'.GL_RGBA=pyprocessing.lights%27-module.html#GL_RGBA"><a title="pyprocessing.lights'.GL_RGBA" class="py-name" href="#" onclick="return doclink('link-76', 'GL_RGBA', 'link-76');">GL_RGBA</a></tt><tt class="py-op">,</tt> <tt id="link-77" class="py-name" targets="Variable pyprocessing.lights'.GL_UNSIGNED_BYTE=pyprocessing.lights%27-module.html#GL_UNSIGNED_BYTE"><a title="pyprocessing.lights'.GL_UNSIGNED_BYTE" class="py-name" href="#" onclick="return doclink('link-77', 'GL_UNSIGNED_BYTE', 'link-77');">GL_UNSIGNED_BYTE</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">buffer</tt><tt class="py-op">)</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">        <tt class="py-name">super</tt> <tt class="py-op">(</tt><tt id="link-78" class="py-name"><a title="pyprocessing.flippolicy.BackupWindow" class="py-name" href="#" onclick="return doclink('link-78', 'BackupWindow', 'link-69');">BackupWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="pyprocessing.flippolicy.AccumWindow.flip
pyprocessing.flippolicy.BackupWindow.flip
pyprocessing.flippolicy.FBOWindow.flip
pyprocessing.flippolicy.SingleBufferWindow.flip" class="py-name" href="#" onclick="return doclink('link-79', 'flip', 'link-47');">flip</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt id="link-80" class="py-name" targets="Variable pyprocessing.lights'.glGetIntegerv=pyprocessing.lights%27-module.html#glGetIntegerv"><a title="pyprocessing.lights'.glGetIntegerv" class="py-name" href="#" onclick="return doclink('link-80', 'glGetIntegerv', 'link-80');">glGetIntegerv</a></tt><tt class="py-op">(</tt><tt id="link-81" class="py-name" targets="Variable pyprocessing.lights'.GL_CURRENT_RASTER_POSITION=pyprocessing.lights%27-module.html#GL_CURRENT_RASTER_POSITION"><a title="pyprocessing.lights'.GL_CURRENT_RASTER_POSITION" class="py-name" href="#" onclick="return doclink('link-81', 'GL_CURRENT_RASTER_POSITION', 'link-81');">GL_CURRENT_RASTER_POSITION</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">currentpos</tt><tt class="py-op">)</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">        <tt id="link-82" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-82', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt> <tt class="py-op">(</tt><tt id="link-83" class="py-name"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-83', 'GL_MODELVIEW', 'link-18');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt id="link-84" class="py-name"><a title="pyprocessing.lights'.glPushMatrix" class="py-name" href="#" onclick="return doclink('link-84', 'glPushMatrix', 'link-15');">glPushMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">        <tt id="link-85" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-85', 'glLoadIdentity', 'link-16');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">        <tt id="link-86" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-86', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt> <tt class="py-op">(</tt><tt id="link-87" class="py-name"><a title="pyprocessing.lights'.GL_PROJECTION" class="py-name" href="#" onclick="return doclink('link-87', 'GL_PROJECTION', 'link-14');">GL_PROJECTION</a></tt><tt class="py-op">)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt id="link-88" class="py-name"><a title="pyprocessing.lights'.glPushMatrix" class="py-name" href="#" onclick="return doclink('link-88', 'glPushMatrix', 'link-15');">glPushMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">        <tt id="link-89" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-89', 'glLoadIdentity', 'link-16');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">        <tt id="link-90" class="py-name" targets="Variable pyprocessing.lights'.glWindowPos2i=pyprocessing.lights%27-module.html#glWindowPos2i"><a title="pyprocessing.lights'.glWindowPos2i" class="py-name" href="#" onclick="return doclink('link-90', 'glWindowPos2i', 'link-90');">glWindowPos2i</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt id="link-91" class="py-name" targets="Variable pyprocessing.lights'.glDisable=pyprocessing.lights%27-module.html#glDisable"><a title="pyprocessing.lights'.glDisable" class="py-name" href="#" onclick="return doclink('link-91', 'glDisable', 'link-91');">glDisable</a></tt><tt class="py-op">(</tt><tt id="link-92" class="py-name" targets="Variable pyprocessing.lights'.GL_DEPTH_TEST=pyprocessing.lights%27-module.html#GL_DEPTH_TEST"><a title="pyprocessing.lights'.GL_DEPTH_TEST" class="py-name" href="#" onclick="return doclink('link-92', 'GL_DEPTH_TEST', 'link-92');">GL_DEPTH_TEST</a></tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt id="link-93" class="py-name" targets="Variable pyprocessing.lights'.glDrawPixels=pyprocessing.lights%27-module.html#glDrawPixels"><a title="pyprocessing.lights'.glDrawPixels" class="py-name" href="#" onclick="return doclink('link-93', 'glDrawPixels', 'link-93');">glDrawPixels</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-94', 'width', 'link-7');">width</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-95', 'height', 'link-8');">height</a></tt><tt class="py-op">,</tt> <tt id="link-96" class="py-name"><a title="pyprocessing.lights'.GL_RGBA" class="py-name" href="#" onclick="return doclink('link-96', 'GL_RGBA', 'link-76');">GL_RGBA</a></tt><tt class="py-op">,</tt> <tt id="link-97" class="py-name"><a title="pyprocessing.lights'.GL_UNSIGNED_BYTE" class="py-name" href="#" onclick="return doclink('link-97', 'GL_UNSIGNED_BYTE', 'link-77');">GL_UNSIGNED_BYTE</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">buffer</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt id="link-98" class="py-name" targets="Variable pyprocessing.lights'.glEnable=pyprocessing.lights%27-module.html#glEnable"><a title="pyprocessing.lights'.glEnable" class="py-name" href="#" onclick="return doclink('link-98', 'glEnable', 'link-98');">glEnable</a></tt><tt class="py-op">(</tt><tt id="link-99" class="py-name"><a title="pyprocessing.lights'.GL_DEPTH_TEST" class="py-name" href="#" onclick="return doclink('link-99', 'GL_DEPTH_TEST', 'link-92');">GL_DEPTH_TEST</a></tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">        <tt id="link-100" class="py-name"><a title="pyprocessing.lights'.glPopMatrix" class="py-name" href="#" onclick="return doclink('link-100', 'glPopMatrix', 'link-42');">glPopMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt id="link-101" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-101', 'glMatrixMode', 'link-13');">glMatrixMode</a></tt> <tt class="py-op">(</tt><tt id="link-102" class="py-name"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-102', 'GL_MODELVIEW', 'link-18');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">        <tt id="link-103" class="py-name"><a title="pyprocessing.lights'.glPopMatrix" class="py-name" href="#" onclick="return doclink('link-103', 'glPopMatrix', 'link-42');">glPopMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">        <tt id="link-104" class="py-name" targets="Variable pyprocessing.lights'.glRasterPos2i=pyprocessing.lights%27-module.html#glRasterPos2i"><a title="pyprocessing.lights'.glRasterPos2i" class="py-name" href="#" onclick="return doclink('link-104', 'glRasterPos2i', 'link-104');">glRasterPos2i</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">currentpos</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">currentpos</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">         </tt>
<a name="BackupWindow.on_resize"></a><div id="BackupWindow.on_resize-def"><a name="L166"></a><tt class="py-lineno">166</tt> <a class="py-toggle" href="#" id="BackupWindow.on_resize-toggle" onclick="return toggle('BackupWindow.on_resize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.BackupWindow-class.html#on_resize">on_resize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">w</tt><tt class="py-op">,</tt><tt class="py-param">h</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BackupWindow.on_resize-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="BackupWindow.on_resize-expanded"><a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt class="py-docstring">"""Window changed size. Must reallocate backing buffer."""</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-name">super</tt> <tt class="py-op">(</tt><tt id="link-105" class="py-name"><a title="pyprocessing.flippolicy.FBOWindow" class="py-name" href="#" onclick="return doclink('link-105', 'FBOWindow', 'link-3');">FBOWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-106" class="py-name"><a title="pyprocessing.flippolicy.BackupWindow.on_resize
pyprocessing.flippolicy.FBOWindow.on_resize
pyprocessing.on_resize" class="py-name" href="#" onclick="return doclink('link-106', 'on_resize', 'link-51');">on_resize</a></tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">,</tt><tt class="py-name">h</tt><tt class="py-op">)</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">buffer</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-name">GLubyte</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">*</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-name">h</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt>  </tt>
</div></div><a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line"> </tt>
<a name="AccumWindow"></a><div id="AccumWindow-def"><a name="L171"></a><tt class="py-lineno">171</tt> <a class="py-toggle" href="#" id="AccumWindow-toggle" onclick="return toggle('AccumWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.flippolicy.AccumWindow-class.html">AccumWindow</a><tt class="py-op">(</tt><tt class="py-base-class">PyprocessingWindow</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AccumWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="AccumWindow-expanded"><a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">    <tt class="py-docstring">"""This is a pyglet window for which an accumulation buffer is defined.</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring">    The flip method is overridden so that instead of merely swapping the</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"><tt class="py-docstring">    back and front buffers, a copy of the back buffer is blitted onto the accum</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line"><tt class="py-docstring">    buffer, and after the flip the accum buffer is copied back.</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring">    The idea is to provide a stable drawing canvas which is not erased or</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring">    corrupted by the flip."""</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">     </tt>
<a name="AccumWindow.__init__"></a><div id="AccumWindow.__init__-def"><a name="L179"></a><tt class="py-lineno">179</tt> <a class="py-toggle" href="#" id="AccumWindow.__init__-toggle" onclick="return toggle('AccumWindow.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.AccumWindow-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">keyargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AccumWindow.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="AccumWindow.__init__-expanded"><a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">        <tt class="py-docstring">"""Constructor"""</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">        <tt class="py-comment"># construct the base class</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-string">'config'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keyargs</tt><tt class="py-op">:</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">            <tt id="link-107" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-107', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">            <tt id="link-108" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-108', 'config', 'link-58');">config</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Config</tt><tt class="py-op">(</tt><tt class="py-name">double_buffer</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">depth_size</tt><tt class="py-op">=</tt><tt class="py-number">24</tt><tt class="py-op">)</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">        <tt id="link-109" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-109', 'config', 'link-58');">config</a></tt><tt class="py-op">.</tt><tt class="py-name">accum_alpha_size</tt> <tt class="py-op">=</tt> <tt class="py-number">8</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">        <tt id="link-110" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-110', 'config', 'link-58');">config</a></tt><tt class="py-op">.</tt><tt class="py-name">accum_red_size</tt> <tt class="py-op">=</tt> <tt class="py-number">8</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">        <tt id="link-111" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-111', 'config', 'link-58');">config</a></tt><tt class="py-op">.</tt><tt class="py-name">accum_green_size</tt> <tt class="py-op">=</tt> <tt class="py-number">8</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt id="link-112" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-112', 'config', 'link-58');">config</a></tt><tt class="py-op">.</tt><tt class="py-name">accum_blue_size</tt> <tt class="py-op">=</tt> <tt class="py-number">8</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-name">keyargs</tt><tt class="py-op">[</tt><tt class="py-string">'config'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-113" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-113', 'config', 'link-58');">config</a></tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-114" class="py-name" targets="Class pyprocessing.flippolicy.AccumWindow=pyprocessing.flippolicy.AccumWindow-class.html"><a title="pyprocessing.flippolicy.AccumWindow" class="py-name" href="#" onclick="return doclink('link-114', 'AccumWindow', 'link-114');">AccumWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="pyprocessing.fbo.FBO.__init__
pyprocessing.flippolicy.AccumWindow.__init__
pyprocessing.flippolicy.BackupWindow.__init__
pyprocessing.flippolicy.FBOWindow.__init__
pyprocessing.flippolicy.SingleBufferWindow.__init__
pyprocessing.pimage.PImage.__init__
pyprocessing.pvector.PVector.__init__
pyprocessing.pvector.overload.__init__
pyprocessing.shapes.CatmullRomBlend.__init__" class="py-name" href="#" onclick="return doclink('link-115', '__init__', 'link-4');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">keyargs</tt><tt class="py-op">)</tt> </tt>
</div><a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">         </tt>
<a name="AccumWindow.flip"></a><div id="AccumWindow.flip-def"><a name="L193"></a><tt class="py-lineno">193</tt> <a class="py-toggle" href="#" id="AccumWindow.flip-toggle" onclick="return toggle('AccumWindow.flip');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.flippolicy.AccumWindow-class.html#flip">flip</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AccumWindow.flip-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="AccumWindow.flip-expanded"><a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">        <tt class="py-docstring">"""Override the flip method."""</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">        <tt class="py-comment"># copy from the the back buffer to the accumulation buffer</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-116" class="py-name" targets="Variable pyprocessing.lights'.glAccum=pyprocessing.lights%27-module.html#glAccum"><a title="pyprocessing.lights'.glAccum" class="py-name" href="#" onclick="return doclink('link-116', 'glAccum', 'link-116');">glAccum</a></tt><tt class="py-op">(</tt><tt id="link-117" class="py-name" targets="Variable pyprocessing.lights'.GL_LOAD=pyprocessing.lights%27-module.html#GL_LOAD"><a title="pyprocessing.lights'.GL_LOAD" class="py-name" href="#" onclick="return doclink('link-117', 'GL_LOAD', 'link-117');">GL_LOAD</a></tt><tt class="py-op">,</tt> <tt class="py-number">1.0</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">        <tt class="py-comment"># do the actual flip</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">super</tt> <tt class="py-op">(</tt><tt id="link-118" class="py-name"><a title="pyprocessing.flippolicy.AccumWindow" class="py-name" href="#" onclick="return doclink('link-118', 'AccumWindow', 'link-114');">AccumWindow</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="pyprocessing.flippolicy.AccumWindow.flip
pyprocessing.flippolicy.BackupWindow.flip
pyprocessing.flippolicy.FBOWindow.flip
pyprocessing.flippolicy.SingleBufferWindow.flip" class="py-name" href="#" onclick="return doclink('link-119', 'flip', 'link-47');">flip</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">        <tt class="py-comment"># copy the accum buffer to the back buffer</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-120" class="py-name"><a title="pyprocessing.lights'.glAccum" class="py-name" href="#" onclick="return doclink('link-120', 'glAccum', 'link-116');">glAccum</a></tt><tt class="py-op">(</tt><tt id="link-121" class="py-name" targets="Variable pyprocessing.lights'.GL_RETURN=pyprocessing.lights%27-module.html#GL_RETURN"><a title="pyprocessing.lights'.GL_RETURN" class="py-name" href="#" onclick="return doclink('link-121', 'GL_RETURN', 'link-121');">GL_RETURN</a></tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Jun 11 22:06:48 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
